#pragma once

#include "Document.hpp"




class FontModel
	: public QAbstractListModel
{
public:

	typedef StyleDocument::Fonts   Fonts;

private:

	Document::ptr   m_document;

public:

	FontModel(const Document::ptr& document = Document::ptr());

	void setDocument(const Document::ptr& document);

	int rowCount(const QModelIndex& parent = QModelIndex()) const;
	QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;

	AdvancedFont& font(const QModelIndex& index);
	const AdvancedFont& font(const QModelIndex& index) const;

	void add(const AdvancedFont& font);
	void remove(const QModelIndex& index);

private:

	int calculateRow(const AdvancedFont& font) const;
};
///////////////////////////////////////////////////////////////////////////////////////////////////
